//
//  TableViewCell.swift
//  NavChange
//
//  Created by 郑东喜 on 2017/1/5.
//  Copyright © 2017年 郑东喜. All rights reserved.
//

import UIKit

class TableViewCell: UITableViewCell {

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    //cell的文字
    var nameLabel: UILabel = {
        let lab = UILabel()
        lab.frame = CGRect(x: 50, y: 0, width: 200, height: 45)
        
        //文字左对齐
        lab.textAlignment = NSTextAlignment.left
        lab.font = UIFont.systemFont(ofSize: 14)
        return lab
    }()
    
    //前置图片
    lazy var imgView: UIImageView = {
        let img = UIImageView()
        //自适应放大
        img.contentMode = UIViewContentMode.scaleAspectFit
        img.frame = CGRect(x: 10, y: 10, width: 25, height: 25)
        return img
    }()

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: .default, reuseIdentifier: "cellID")
        
        imgView.image = UIImage.init(named: "BgV")
        
        addSubview(nameLabel)
        addSubview(imgView)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
